package lang.object;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author 李栋
 * @version 1.0.0
 * @className DemoOneClass.java
 * @createTime 2021年08月18日 21:02:00
 */
public class DemoOneClass {

    private static final Logger logger = LoggerFactory.getLogger(DemoOneClass.class);

    static {
        logger.info("静态代码块！");
    }

    {
        logger.info("初始化块！");
    }


    /**
     * Class.forName加载并初始化了一个类
     * <p>
     * ClassLoader仅加载了类
     *
     * @param args
     * @throws ClassNotFoundException
     */
    public static void main(String[] args) throws ClassNotFoundException {
        Class.forName("lang.object.DemoOneClass");
        logger.info("==================================");
        ClassLoader.getSystemClassLoader().loadClass("lang.object.DemoOneClass");
    }

}
